package com.airticketbooking.mapper;

import com.airticketbooking.po.Seat;
import com.airticketbooking.vo.SeatVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author Mr.J
 * @version 1.0.0
 * @date 2024/10/12
 * @desc
 */

@Mapper
public interface SeatMapper {


	Page<SeatVO> list(Integer classId, Integer scheduleId);

	@Select("SELECT * FROM airticketbooking.seats WHERE seat_id = #{seatId}")
	Seat getById(Integer seatId);


	@Select("SELECT * FROM airticketbooking.seats WHERE airplane_id = #{airplaneId} and status=1")
	List<Seat> getSeatsByAirplaneId(Integer airplaneId);

	void updateSeat(Seat seat);

	@Select("SELECT * FROM airticketbooking.seats WHERE airplane_id = #{airplaneId}")
	List<Seat> getSeatsByAirplaneIdAndWithoutStatus(Integer airplaneId);
}
